package com.example.dsplatform.Controller;

import cn.hutool.core.util.StrUtil;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.example.dsplatform.Service.LogsService;
import com.example.dsplatform.pojo.Entity.Logs;
import com.example.dsplatform.pojo.Entity.ResponseResult;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import java.util.List;

/**
 * 系统日志相关接口
 */
@RestController
@RequestMapping("/logs")
public class LogsController {

    @Autowired
    LogsService logsService;



    /**
     * 删除信息
     */
    @DeleteMapping("/delete/{id}")
    public  ResponseResult  delete(@RequestBody Logs logs) {
        logsService.deleteLogs(logs);
        return new ResponseResult(200,"删除成功");
    }


    /**
     * 批量删除信息
     */
  /*  @DeleteMapping("/delete/batch")
    public  ResponseResult  batchDelete(@RequestBody List<Integer> ids) {
        logsService.removeBatchByIds(ids);
        return new ResponseResult(200,"删除成功");
    }*/

    /**
     * 多条件模糊查询信息
     * pageNum 当前的页码
     * pageSize 每页查询的个数
     */
    @GetMapping("/selectByPage")
    public ResponseResult selectByPage(){
        return  logsService.selectLogs();

    }
    
}